const BASE_URL='http://ptapi.njkw668.com/'
export const myRequest=(options)=>{
	return new Promise((resolve,reject)=>{
		//console.log(options.data)
		//let method=options.method;
		uni.request({
			url:BASE_URL+options.url,
			method:options.method||"GET",
			data:options.data||{},
			dataType: 'json',  
			 header: {  
			         'content-type': 'application/x-www-form-urlencoded;application/json;charset=UTF-8',  
			          
			          },  
			success:(res)=>{
				//console.log(res)
				if(res.data.status!=200){
					return uni.showToast({
						title:'获取数据失败'
					})
				}
				resolve(res.data)
			},
			fail:(err)=> {
				uni.showToast({
					title:'请求接口失败'
				})
				reject(err)
				
			}
			
		})
	})
}